/**
 * Author: Zane
 * Email: 873934580@qq.com
 * Date: 2023/5/1
 */
import 'normalize.css/normalize.css'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/display.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import '@/assets/style/base.scss'
import { createApp } from 'vue'
import App from './app.vue'
import routers from '@/routers'
import ElementPlus from 'element-plus'
import { createPinia } from 'pinia'
import piniaPersist from 'pinia-plugin-persist'
import { $http, upload_url, getAuth } from '@/api'
import { FormMaker } from '@pangtou/form'
import { TableMaker } from '@pangtou/table'

const pinia = createPinia()
const app = createApp(App)
pinia.use(piniaPersist)

app.use(routers)
app.use(ElementPlus)
app.use(pinia)
app.config.globalProperties.$http = $http

app.use(FormMaker, {
    upload: {
        url: upload_url,
        extend: getAuth,
    },
    http: $http,
    icon: [{ name: '表单图标', type: 'css', value: '//at.alicdn.com/t/c/font_4122376_n92ekwagv9.css' }],
})

app.use(TableMaker, {
    http: $http,
})

app.mount('#app')
